An interface in Solidity is an abstract type that specifies the

behaviour of the contract. The interface declares the function

signatures which are external in nature, that an inheriting contract

has to implement. It can also not declare the constructor or state

variables.

2.5.7.7 Events

Events are an abstraction on top of the Ethereum Virtual Machine’s

logging functionalities. They are especially useful for integration with

the front end code. The front end code can work as an observer with

the call back functions waiting for a particular event to have

occurred. In the decentralized applications, events play a major role

in knowing the status of a transaction.

2.5.7.8 Order of Elements in Solidity File

While writing the Solidity code, we must make sure that all its

elements are in a particular order. When you’re writing the Solidity

code, you should first make sure to use a proper layout. The

contracts should be at the end of it. The following is the proper order

of elements:

1. The pragma statement – which handles the associated compiler

version.

2. Import statements – that imports the other files to the current.

3. Interfaces – which are the abstract types for a contract.

4. Libraries – mostly utilities or common codes.

5. Contracts – every Solidity file can have one or more contracts

within them.

2.5.7.9 Order of Elements in a Contract

Libraries, interfaces, and contracts have their own elements as well.

The inner elements of each contract should have the following order:

1. Type declarations

2. State variables